﻿using System;
using Gizmox.WebGUI.Forms;

namespace CoCoon.Forms.Ribbon
{
    [Serializable]
    public class RibbonBarDateTimePickerItem : RibbonBarTextBoxItem
    {

        protected override Control CreateControl()
        {
            DateTimePicker = new DateTimePicker();
            DateTimePicker.Format = DateTimePickerFormat.Short;
            return (Control)DateTimePicker;
        }

        public DateTimePicker DateTimePicker { get; set; }

        public DateTime Value { get { return DateTimePicker.Value; } set { DateTimePicker.Value = value; } } 

        public event EventHandler ValueChanged
        {
            add { DateTimePicker.ValueChanged += value; }
            remove { DateTimePicker.ValueChanged -= value; }
        }
    }
}